Repository navigation
Conversation
… closes and reverts, reviewer asks, and guide pull requests What becomes of every pull request CoderHelm opens is now counted, and what people do with one teaches the next run. Scorecard (common::scorecard). Per repository and per team: opened, merged, closed without merging, reverted, review rounds to approval, open to merge, merged after a person's commit, finished with open items. Each pull request has one small record the webhooks change (opened, a person's review, a person's push to its branch, closed or merged, reopened, a revert pull request or revert commit naming it). Every change adds the difference between what the record counted for before and after to the counters, in the transaction that writes the record, so a redelivered or late event counts nothing twice and nothing is recomputed by reading runs. The worker's reconcile path counts a close the webhook missed. GET /api/learning/scorecard serves it. Lessons from outcomes (common::rewards::lessons, passes::outcome_learning). When people push commits on top of a CoderHelm pull request, close one with a comment, or revert one with a reason, the worker reads their own words and the lines they changed and asks the team's model for at most one lesson. A lesson is kept only when it names code and says how to check a change against it. It goes through the existing lessons store with the evidence attached, is counted once per pull request, reinforces the kept lesson that says the same, and counts against the kept lessons it contradicts, which lose weight until they are no longer recalled. A revert now writes the area's lesson again and carries the reason; a revert by commit is recognised as well as GitHub's revert pull request. Only people with standing in the repository are read. Reviewer asks (common::reviewer_prefs). What each reviewer asked for on CoderHelm's pull requests is distilled into general asks kept per login within the team, in a fixed list of review categories, with mentions, addresses and links removed and anything about a person dropped. An ask seen on two pull requests is given to the build and to CoderHelm's review of its own pull request when that reviewer is a code owner of the files or reviewed that part of the repository recently. The team can list the asks and forget a reviewer or one ask. Guide file (common::guide, passes::guide_pr). The run already reads the repository's guide files every run; CONTRIBUTING.md is now read too. A lesson seen on two pull requests and never contradicted is proposed for the guide file as a pull request of its own: one commit on a new branch, never a write to the default branch, at most one open per repository, with a pause after one merges and a longer one after one is closed. When it closes, lessons still in the merged file are marked as in the guide and leave the prompt; lessons people removed, or all of a closed one, are declined and count as contradicted. No new tables, indexes or permissions: every record is on the settings table under the team's own key.
… and no review by CoderHelm of its own lessons A team can turn guide pull requests off, for every repository or for one (SETTINGS#GUIDE_PRS; on unless turned off, a repository's own setting wins over the team's). The switch is read before anything is claimed, read from GitHub or created: off, there is no branch, no commit, no pull request and no claim on the repository's record, and lessons reach the prompt exactly as before. A switch that cannot be read counts as off. A guide pull request already open when the switch goes off is still settled when it closes. GET and PUT /api/settings/guide-prs serve it; saving needs the learning capability's admin role. A guide pull request says where it comes from three ways: its title starts "CoderHelm lessons:", its description opens by saying it comes from CoderHelm's lessons and not from a ticket and that an admin can turn these off, and it carries the coderhelm-lessons label. CoderHelm's reviewer leaves a guide pull request to the team. Before this, a repository with the reviewer on would have reviewed it as CoderHelm's own pull request once it carried the review label or someone asked: findings written into its description as open, with no run behind it to fix them. Now the gateway queues no review job for one, and the worker's review ends before any model call with a neutral check that says it is for the team to review, whatever started it.
Both sides added a module to common, an incident case and its row in docs/incidents.md; all are kept.
Both sides added an incident case and its row in docs/incidents.md; all are kept.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
CoderHelm gets a learning loop for the pull requests it opens. What becomes of each one is counted from the webhooks as they arrive, what people do with one (their own commits on top, the comment they close it with, the reason they revert it) becomes a lesson the next run is given, what each reviewer keeps asking for is given to the build when that reviewer is likely to review the change, and lessons seen on several pull requests are proposed for the repository's guide file as a pull request the team reviews.
Most of the machinery was already there and is reused: outcome events (
common::rewards), the lessons store with its half-life, the change log an admin can turn off, the run reading the repository's guide files every run. This adds what was missing on top of it.No new tables, indexes or permissions. Every record is on the settings table under the team's own key.
Changes
Scorecard (
common::scorecard,gateway/routes/scorecard.rs)SCOREPR#), changed by the webhooks: opened, reopened, a person's review, a person's push to its branch, closed or merged, a revert pull request or a revert commit naming it.SCORE#<month or ALL>#Tand#R#<repo>), in the transaction that writes the record and only when the record is still the one that was read. A redelivered or late event counts nothing twice, events may arrive in any order, and nothing is recomputed by reading runs.GET /api/learning/scorecard?months=N&repo=(months=0is all time). A rate with nothing behind it isnull, never zero.Lessons from outcomes (
common::rewards::lessons,worker/passes/outcome_learning.rs)git revert(a commit naming the merge commit) is recognised as well as GitHub's revert pull request.Reviewer asks (
common::reviewer_prefs)GET /api/learning/reviewerslists them;POST /api/learning/reviewers/forget(admins) forgets one ask or everything kept about a reviewer.Guide file (
common::guide,worker/passes/guide_pr.rs)AGENTS.md,CLAUDE.mdand the other agent files every run; it now readsCONTRIBUTING.mdtoo, last, under the same byte cap.GETandPUT /api/settings/guide-prs; on unless turned off, a repository's own setting wins). The switch is read before anything is claimed or created: off, no branch, commit or pull request is made and lessons still reach the prompt. A switch that cannot be read counts as off.coderhelm-lessonslabel.GET /api/learning/lessonslists the coder's lessons with their evidence and state, and each repository's guide pull request.Shared files touched, kept small
worker/src/passes/mod.rs: twopub modlines, andCONTRIBUTING.mdinINSTRUCTION_FILES.worker/src/passes/review_pr.rs: the own-review context gets the likely reviewers' asks (one block).worker/src/passes/incidents/ac_partial_and_red_ci.rs:guide_pr.rsjoins the list of places that may open a pull request, as the guide pull request and not a run's.gateway/src/routes/github_webhook.rs: calls intoroutes/scorecard.rsat opened, reopened, closed, a person's review and a push; the revert handler passes the reason on.resume.rsandimplement.rsare not touched.Not in this change
Verification
Run locally on this branch (both commits), at main
9582ee99:cargo fmt --check --all: clean.cargo clippy --workspace --all-targets -- -D warnings: clean.cargo test --workspace -- 'incidents::': 166 passed, 0 failed.cargo test --workspace -- 'replay::': 5 passed, 0 failed.cargo test --workspace -- --skip 'incidents::' --skip 'replay::': common 2124, gateway 906, worker 1465 passed, 0 failed.What the tests cover:
nullwhere nothing is behind a rate.al_learning_loopreplays the whole loop on the fixture repository with webhook payloads in GitHub's shapes and recorded model replies read by the real parser, and checks the pipeline still calls each piece at its place.docs/incidents.mdhas its row.routes::scorecard::tests).Not verified live: nothing here ran against GitHub, DynamoDB or a model. The DynamoDB transaction in
scorecard::Dynamo::commit, the lesson and reviewer updates in the stores, and the real GitHub calls ofguide_pr::GitHubRepoare exercised only through their in-memory stand-ins. The dashboard change is CoderHelm/coderhelm#406; its sections stay hidden until a gateway with these routes is deployed.